﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Microsoft.Practices.EnterpriseLibrary.Data;
using System.Data.Common;
using System.Data;

public partial class MRP_DailyReportInput : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void UIServer1_DBChange(object sender, Evolutility.UIServer.DatabaseEventArgs e)
    {
        //if (e.Action == Evolutility.UIServer.DBAction.UPDATE)
        {

            Database db = DatabaseFactory.CreateDatabase("MRPSqlServer");

            int id = e.ID;

            string sqlCommand = "MRP_ChangeDailyReportStatus";
            DbCommand dbCommand = db.GetStoredProcCommand(sqlCommand);
            db.AddInParameter(dbCommand, "itemID", DbType.Int32, id);
            //db.AddInParameter(dbCommand, "@ErrorRange", DbType.Decimal,1);//假设误差为1%
            int iret = db.ExecuteNonQuery(dbCommand);

        }
    }
}
